const DB = wx.cloud.database().collection("aid_game_Drowning")
Page({

  /**
   * 页面的初始数据
   */
  data: {
    aid_game_Drowning:[],
    hide_Happening1:[],
    hide_reaction1:[],
    hide_reaction2: [],
    hide_reaction3: [],
    hide_reaction4: [],

    h_solution1: true,
    h_solution2: true,
    h_situation1: true,
    h_situation2: true,
    h_Happening1: true,
    h_Happening2: true,
    h_Happening3: true,
    h_reaction1: true,
    h_reaction2: true,
    h_reaction3: true,
    h_reaction4: true,
  },
  
  // 做法一
  solution1: function(e) {
    this.setData({
      h_solution1: !this.data.h_solution1,
      h_solution2:true,
      
    })
  },
  // 做法二
  solution2: function (e) {
    this.setData({
      h_solution2: !this.data.h_solution2,
      h_solution1:true,
      
    })
  },
  // situation1情形一
  situation1: function (e) {
    this.setData({
      h_situation1: !this.data.h_situation1,
      h_situation2: true,
      
    })
  },
  // situation1情形二
  situation2: function (e) {
    this.setData({
      h_situation2: !this.data.h_situation2,
      h_situation1: true,
     
    })
  },
  // 情况一
  Happening1: function(e) {
    this.setData({
      h_Happening1: !this.data.h_Happening1,
      h_Happening2: true,
      h_Happening3: true,
    })
  },
  // 情况二
  Happening2: function (e) {
    this.setData({
      h_Happening2: !this.data.h_Happening2,
      h_Happening1: true,
      h_Happening3: true,
    })
  },
  // 情况三
  Happening3: function (e) {
    this.setData({
      h_Happening3: !this.data.h_Happening3,
      h_Happening1: true,
      h_Happening2: true,
      
    })
  },
  // 反应
  reaction1: function(e) {
    this.setData({
      h_reaction1: !this.data.h_reaction1,
      h_reaction2: true,
      h_reaction3: true,
      h_reaction4: true,
    })
  },
  reaction2: function (e) {
    this.setData({
      h_reaction2: !this.data.h_reaction2,
      h_reaction1: true,
      h_reaction3: true,
      h_reaction4: true,
    })
  },
  reaction3: function (e) {
    this.setData({
      h_reaction3: !this.data.h_reaction3,
      h_reaction1: true,
      h_reaction2: true,
      h_reaction4: true,
    })
  },
  reaction4: function (e) {
    this.setData({
      h_reaction4: !this.data.h_reaction4,
      h_reaction1: true,
      h_reaction3: true,
      h_reaction2: true,
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    //滚动播报连接数据库aid_swiper
    DB.get({
      success: res => {
        console.log(res.data)
        this.setData({
          aid_game_Drowning: res.data,
          hide_Happening1: res.data[0].h_Happening1.split("|"),
          hide_reaction1: res.data[0].h_reaction1.split("|"),
          hide_reaction2: res.data[0].h_reaction2.split("|"),
          hide_reaction3: res.data[0].h_reaction3.split("|"),
          hide_reaction4: res.data[0].h_reaction4.split("|"),
        })
      }
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})